module SOD
  
  class AppObserver < Sketchup::AppObserver
    
    def onNewModel(model)
      Plugin.newModel
      Plugin.projectManager.resetFiles
      Plugin.start
    end
    
    def onUnloadExtension(model)
      UI.messagebox "bye, bye"
    end
    
    def onOpenModel(model)
      
      
      Plugin.newModel
      Plugin.start
      
      if not Plugin.path.nil?
        Plugin.projectManager.setActiveProject(Plugin.path)
        Plugin.projectManager.resetFiles
      end
    end
    
    def onQuit(model)
      
    end
    
  end
end
